package com.itheima.game2plus;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Car[] cars=new Car[3];
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i < cars.length; i++) {
            Car c=new Car();
            System.out.println("输入汽车品牌");
            c.setBrand(sc.next());
            System.out.println("输入汽车价格");
            c.setPrice(sc.nextInt());
            System.out.println("输入汽车颜色");
            c.setColor(sc.next());
            cars[i]=c;
        }
        System.out.println(cars[0]);
        System.out.println(cars[1]);
        System.out.println(cars[2]);
    }
}
